import request from '@/utils/request'

// 查询预付款列表
export function listAdvance(query) {
  return request({
    url: '/finance/advance/list',
    method: 'get',
    params: query
  })
}

// 查询预付款详细
export function getAdvance(requestId) {
  return request({
    url: '/finance/advance/' + requestId,
    method: 'get'
  })
}

// 修改预付款
export function updateAdvance(data) {
  return request({
    url: '/finance/advance',
    method: 'put',
    data: data
  })
}

//核准
export function getUpdateAdvanceApplicant(requestId, flay) {
  return request({
    url: '/finance/advance/updateAdvanceApplicant/' + requestId + "/" + flay,
    method: 'put'
  })
}

//查询是否可以批量付款的数据
export function getSelectAdvanceByRequestId(requestId) {
  return request({
    url: '/finance/advance/selectAdvanceByRequestId/' + requestId,
    method: 'get'
  })
}

//批量付款
export function getUpdateAdvanceByAdvanceStatus(requestId) {
  return request({
    url: '/finance/advance/updateAdvanceByAdvanceStatus/' + requestId,
    method: 'put'
  })
}

//修改取消申请的状态
export function getUpdateRequestAdvanceCancelStatus(requestId) {
  return request({
    url: '/finance/advance/updateRequestAdvanceCancelStatus/' + requestId,
    method: 'put'
  })
}

//付款完成需要修改申请记录的付款状态
export function getUpdateRequestAdvancePaymentStatus(requestId) {
  return request({
    url: '/finance/advance/updateRequestAdvancePaymentStatus/' + requestId,
    method: 'put'
  })
}

//批量添加付款单
export function getInsertPaymentSlipsList(data) {
  return request({
    url: '/finance/advance/insertPaymentSlipsList',
    method: 'post',
    data: data
  })
}


